package com.kernel;

import java.util.Observable;
import java.util.Observer;

/****************************************
 * @name HouseObserver
 * @description 观察者
 * @author 黄彬恒
 * @since 2018/7/31
 ***************************************/
public class HouseObserver implements Observer {

    private String name; //每个购房者的名字

    public HouseObserver(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        if (arg instanceof Float) {
            System.out.println(this.name + "观察到房价变更为：" + arg);
        }
    }
}
